


    //创建地图
    var mapz = new AMap.Map('container', {
    zoom: 10,
    center: [120.693023,31.344858, 120.552981,31.294564],
    showIndoorMap: true
});

    //显示当前地图边界范围坐标
    function logMapBounds() {
    var bounds = mapz.getBounds();
    document.querySelector("#ne").innerText = bounds.northEast.toString();
    document.querySelector("#sw").innerText = bounds.southWest.toString();
}

    logMapBounds();

    //绑定地图移动与缩放事件
    mapz.on('moveend', logMapBounds);
    mapz.on('zoomend', logMapBounds);

    //绑定按钮事件
    document.querySelector("#reset-bounds").onclick = function() {
    //通过 new AMap.Bounds(southWest:LngLat, northEast:LngLat) 或者 map.getBounds() 获得地图Bounds信息
    var mybounds = new AMap.Bounds([120.643545,31.34102], [120.558387,31.291307]);
    mapz.setBounds(mybounds);
}


